package tut.Struct.collection.phan1.map.marinHashMap;

import java.util.HashMap;

public class TestCompareProcessTime {

	public static final int LOOP = 2;
	public static final int POSITION = 1;

	public static void main(String[] args) {



		HashMap<MarinSummaryKey, MarinValue> map = new HashMap<MarinSummaryKey, MarinValue>();
		HashMap<MarinSummaryKeyHash, MarinValue> map2 = new HashMap<MarinSummaryKeyHash, MarinValue>();

		MarinSummaryKey k1 = new MarinSummaryKey(5,5);
		MarinValue v1 = new MarinValue(1000+2, 1000+11);

		map.put(null, v1);
		MarinValue v2 =  map.get(null);

		map.put(null, null);
		MarinValue v3 =  map.get(null);

		for (int i = 0, j = 0; i < LOOP; i++, j++) {
			MarinSummaryKey key = new MarinSummaryKey(i, j);
			MarinValue value = new MarinValue(1000+i, 1000+j);
			map.put(key, value);
		}


		System.out.println("----------------------------------");

		for (int i = 0, j = 0; i < LOOP; i++, j++) {
			MarinSummaryKeyHash key = new MarinSummaryKeyHash(i, j);
			MarinValue value = new MarinValue(1000+i, 1000+j);
			map2.put(key, value);
		}


		MarinValue value1 = (MarinValue)map.get(new MarinSummaryKey(POSITION, POSITION));
		MarinValue value2 = (MarinValue)map2.get(new MarinSummaryKeyHash(POSITION, POSITION));

		System.out.println(value1.cvUniq + ", " + value1.mediaId + ", " + value1.revenue );
		System.out.println(value2.cvUniq + ", " + value2.mediaId + ", " + value2.revenue );

		value2 = (MarinValue)map2.get(new MarinSummaryKeyHash(0, 0));
		System.out.println(value2.cvUniq + ", " + value2.mediaId + ", " + value2.revenue );


		System.out.println("----------------------------------");

	}
/*
    LOOP = 1000
	Start map 1 = 1380778619802
	End map 1 = 1380778619815
	Proccess time = 13
	----------------------------------
	Start map 2 = 1380778619815
	End time = 1380778619816
	Proccess time = 1
*/

/*
 	LOOP = 100000;
 	Start map 1 = 1380785110172
	End map 1 = 1380785143139
	Proccess time = 32967
	----------------------------------
	Start map 2 = 1380785143140
	End time = 1380785144517
	Proccess time = 1377
*/


}
